'use strict';

function collect_min_number(collection) {
  let result=collection.reduce(function(item1,item2){
    if(item1<=item2){
      return item1;
    }
    else{
      return item2;
    }
  });
  console.log(result);
  return result;
}

module.exports = collect_min_number;
collect_min_number([1, 8, 9, 21, 5]);

